<template>
    <div>
        <!-- 查询框 -->
        <el-popover placement="bottom-start" width="1000" style="box-shadow: 0 0 8px rgba(0,0,0,.5);" trigger="click">
            <el-form :inline="true" :model="root.popover.form"  label-width="120px">                                         
                <el-form-item label="浆员姓名=" style="margin-bottom: 0;margin-top: 5px;">
                    <el-input v-model="root.popover.form.providerName" style="width: 150px;" clearable></el-input>
                </el-form-item>
                <el-form-item label="记录生成时间>=" style="margin-bottom: -10px; margin-top: 5px;">
                     <el-date-picker
                        v-model="root.popover.form.createTimeGreater"
                        type="date"
                        placeholder="选择日期">
                    </el-date-picker>
                </el-form-item>                          
                <el-form-item label="记录生成时间<=" style="margin-bottom: -10px; margin-top: 5px;">
                     <el-date-picker
                        v-model="root.popover.form.createTimeLess"
                        type="date"
                        placeholder="选择日期">
                    </el-date-picker>
                </el-form-item>
                <br/>
                <el-form-item label="护士姓名=" style="margin-bottom: -10px; margin-top: 15px;">
                    <el-select  v-model="root.popover.form.nurseName" style="width: 150px;" >
                        <el-option value="" label="【空】"></el-option>
                        <el-option  v-for="item in root.popover.cache.nurseData" :key="item.id" :value="item.name" :label="item.name"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="链接日期>=" style="margin-bottom: -10px; margin-top: 15px;">
                     <el-date-picker
                        v-model="root.popover.form.linkTimeGreater"
                        type="date"
                        placeholder="选择日期">
                    </el-date-picker>    
                </el-form-item>                          
                <el-form-item label="链接日期<=" style="margin-bottom: -10px; margin-top: 15px;">
                     <el-date-picker
                        v-model="root.popover.form.linkTimeLess"
                        type="date"
                        placeholder="选择日期">
                    </el-date-picker>
                </el-form-item>
                <br/>
                <el-form-item label="是否新浆员=" style="margin-bottom: -10px; margin-top: 25px;">
                    <el-select  v-model="root.popover.form.isNew" style="width: 150px;" >
                        <el-option value="" label="【空】"></el-option>
                        <el-option value="1" label="是"></el-option>
                        <el-option value="2" label="否"></el-option>
                    </el-select>
                </el-form-item>
                    <br/>                       
                    <el-button type="primary"  @click="initRootTableData('all')" style="float:right;margin-top: 20px;margin-right: 25px;">搜索</el-button>
                    <el-button type="primary"  @click="initRootTableData('clear')" style="float:right;margin-top: 20px;margin-right: 15px;">刷新</el-button>
            </el-form>
                    <el-button slot="reference" type="primary">查询</el-button> 
        </el-popover>
        <!-- 按钮框 -->
        <el-button  type="primary" @click="addButtonEventFun" style="margin-left: 10px;">添加</el-button>
        <el-button  type="primary" @click="initRootTableData('clear')">刷新</el-button>
        <!-- 表格 -->
        <el-table :data="root.table.rowsData" stripe border class="company-table" style="width: 100%;" :height="outHeight" v-loading="root.table.option.loading">
            <el-table-column prop="providerName" label="浆员姓名" sortable min-width="90">
            </el-table-column>
            <el-table-column prop="isNew" label="是否新浆员" sortable min-width="90">
                <template slot-scope="scope">
                    <div v-html="scope.row.isNew==1?'是':'否'"></div>
                </template>
            </el-table-column>
            <el-table-column prop="linkTime" label="链接日期" sortable min-width="120">
                <template slot-scope="scope">
                    <div v-html="timestampToTime(scope.row.linkTime,'yyyy-mm-dd')"></div>
                </template>
            </el-table-column> 
            <el-table-column prop="linkPoint" label="五步链接环节" sortable min-width="90">
            </el-table-column>
            <el-table-column prop="linkEffect" label="五步链接效果" sortable min-width="90">
            </el-table-column>
            <el-table-column prop="linkPromise" label="五步链接承诺" sortable min-width="90">
            </el-table-column>
            <el-table-column prop="linkNurseName" label="护士姓名" sortable min-width="90">
            </el-table-column>
            <el-table-column fixed="right" label="操作" sortable align="center" min-width="75">
                <template slot-scope="scope">
                    <el-button  @click="editButtonEventFun('edit',scope.row)" type="text" size="small">编辑</el-button>
                </template>
            </el-table-column>
        </el-table>
        <!-- 分页 -->
        <el-pagination background @size-change="xySizeChange" @current-change="xyCurrentChange" :current-page="root.table.pagination.currentPage" :page-sizes="[10, 15,20, 25,30,50, 100]" :page-size="root.table.pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="root.table.pagination.total"></el-pagination>    
        <!-- 弹窗 -->
        <el-dialog  :title="root.dialog.config.title" :visible.sync="root.dialog.config.isShow"  :close-on-click-modal="false" top="2vh" width="55%" v-dialogDrag style="margin-top: -25px;"> 
            <div :style="root.dialog.height"> 
               <h3  class="dialog-plate-title"><span>相关信息</span></h3>
                <el-form :inline="true" :model="root.dialog.form" class="demo-ruleForm" label-width="100px;">                                         
                    <el-form-item label="护士姓名">
                        <el-select  v-model="root.dialog.form.nurse" value-key="id"  style="width: 200px;">
                            <el-option  v-for="item in root.popover.cache.nurseData" :key="item.id"  :value="item" :label="item.name"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="浆员姓名" style="margin-bottom: 0;">
                        <el-input v-model="root.dialog.form.providerName" style="width: 150px;" clearable>
                        <el-button slot="append" icon="el-icon-search" @click="innerDialogShow('provider')"></el-button>
                        </el-input>
                    </el-form-item>
                    <el-form-item label="是否新浆员">
                        <el-select v-model="root.dialog.form.isNew" placeholder="请选择" style="width: 120px;">
                            <el-option label="是" value="1"></el-option>
                            <el-option label="否" value="2"></el-option>
                        </el-select>
                    </el-form-item>
                    <br/>
                    <el-form-item label="链接时间" style="margin-top: 5px;">
                         <el-date-picker
                            v-model="root.dialog.form.linkTime"
                            type="date"
                            placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>
         
                    <el-form-item label="记录日期" style="margin-top: 5px;">
                        <el-input v-model="root.dialog.form.createTime" style="width: 150px;" clearable disabled></el-input>
                    </el-form-item>
                    <br/>
                    <el-form-item label="五步链接环节" style="margin-top: 5px;">
                        <el-checkbox-group v-model="root.dialog.form.linkPoint"  label-width="200px" >
                            <el-checkbox v-for="item in root.dialog.cache.linkPointDataItem" :label="item.name" :key="item.name">{{item.name}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <br/>
                    <el-form-item label="五步链接效果" style="margin-top: 5px;">
                        <el-checkbox-group v-model="root.dialog.form.linkEffect"  label-width="200px" >
                            <el-checkbox v-for="item in root.dialog.cache.linkEffectDataItem" :label="item.name" :key="item.name">{{item.name}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <br/>
                    <el-form-item label="五步链接承诺" style="margin-top: 5px;">
                        <el-checkbox-group v-model="root.dialog.form.linkPromise"  label-width="200px" >
                            <el-checkbox v-for="item in root.dialog.cache.linkPromiseDataItem" :label="item.name" :key="item.name">{{item.name}}</el-checkbox>
                        </el-checkbox-group>
                    </el-form-item>
                    <br/>
                    <h3  class="dialog-plate-title"><span>浆员信息</span></h3>
                    <pulpworkInfo :cardid="root.dialog.pulpworkInfo.cardid" :datatype="root.dialog.pulpworkInfo.datatype" style="width:100%"></pulpworkInfo>
                    <el-button  type="primary" style="margin-top: 10px;" @click="updateButtonEventFun">提交</el-button>
                    <br/>
                </el-form>
                   <!-- 内部弹窗dialog,显示选择浆员与义工的弹窗 -->
                <el-dialog  :title="dialog.inner.config.title" :visible.sync="dialog.inner.config.isShow"   width="1000px" top="60px" :close-on-click-modal="false" append-to-body  v-dialogDrag>
                    <div :style="dialog.inner.height">
                                    <!-- 内部查询框 -->
                                      <!-- 查询 -->
                                    <el-popover placement="bottom-start" width="900" style="box-shadow: 0 0 8px rgba(0,0,0,.5);" trigger="click">
                                        <el-form :inline="true" :model="tableData.inner.search" class="demo-ruleForm">                                         
                                            <el-form-item label="卡号=" style="margin-bottom: 0;">
                                                    <el-input v-model="tableData.inner.search.providerId" style="width: 150px;"></el-input>
                                            </el-form-item>
                                            <el-form-item label="姓名=" style="margin-bottom: 0;">
                                                    <el-input v-model="tableData.inner.search.providerName" style="width: 150px;"></el-input>
                                            </el-form-item>
                                            <el-form-item label="身份证≈" style="margin-bottom: 0;">
                                                    <el-input v-model="tableData.inner.search.providerSFZ" style="width: 150px;"></el-input>
                                            </el-form-item>                          
                                            <el-button type="primary"  @click="getInitInnerTableXyList('all')" style="float:right;margin-top: 20px;margin-right: 20px;">搜索</el-button>
                                            <el-button type="primary"  @click="getInitInnerTableXyList('clear')" style="float:right;margin-top: 20px;margin-right: 20px;">刷新</el-button>
                                        </el-form>
                                        <el-button slot="reference" type="primary">查询</el-button>
                                    </el-popover>
                                            <!-- 内部表格 -->
                                    <el-table  @row-click="fetchRowInfo" :data="tableData.inner.tbody.rowsData" stripe border class="company-table" style="width: 100%;" :height="innerTableHeight" v-loading="option.loading">
                                        <el-table-column prop="头像" label="头像" sortable min-width="30">
                                                 <template slot-scope="scope">
                                                    <img :src="scope.row.photo" style="width: 25px;height:30px">
                                                 </template>
                                        </el-table-column>
                                        <el-table-column prop="cardId" label="卡号" sortable min-width="90"></el-table-column>
                                        <el-table-column prop="name" label="姓名" sortable min-width="90"></el-table-column>
                                        <el-table-column prop="idNo" label="身份证" sortable min-width="180"></el-table-column>
                                        <el-table-column prop="isVolunteer" label="是否义工" sortable min-width="90">
                                             <template slot-scope="scope">
                                                    <div>{{scope.row.isVolunteer == null ? "否" : "是"}}</div>
                                             </template>
                                        </el-table-column>
                                    </el-table> 
                                    <el-pagination background @size-change="xyLinkInnerSizeChange" @current-change="xyLinkInnerCurrentChange" :current-page="tableData.inner.pagination.currentPage" :page-sizes="[10, 15,20, 25,30,50, 100]" :page-size="tableData.inner.pagination.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="tableData.inner.pagination.total"></el-pagination>  
                    </div>
                </el-dialog>

            </div>
        </el-dialog>
    </div>
</template>
<script>
import bloodSourcesHttp from 'plugins/axios/bloodSourcesHttp.js';
import api from 'plugins/axios/api.js';
import analysisHttp from 'plugins/axios/analysisHttp.js';
import pulpworkInfo from 'views/operationManage/components/pulpworkInfo.vue';
export default {
    data(){
        return{
            linkPointDataItem:['12312','212312'],
            option:{
                loading:false,
                isProvider:true
             },
            dialog:{
                    //内层嵌套dialog配置
                    inner:{
                        height:{
                            height: document.documentElement.clientHeight - 100+ 'px',
                            overflowY: 'auto',
                            marginTop: -50+ 'px '
                        },
                        config:{
                            isShow:false,
                            title:'内层弹窗',
                            type:'',
                        }
                     }
            },
            tableData:{
                        search:{
                            nurseName:null,
                            providerName:null,
                            providerActiveLevel:null,
                            useVolunteer:null,
                            providerAddress:null,
                            nurseId:null               
                        },
                        thead:{},
                        tbody:{
                            rowsData:[]
                        },
                        tfooter:{},
                        inner:{
                            search:{
                                    providerId:null,
                                    providerName:null,
                                    providerSFZ:null            
                                },
                            tbody:{
                                    rowsData:[]
                                },
                            pagination:{
                                currentPage:1,
                                pageSize:10,
                                total:0
                            }  
                        },
                        nurse:{
                            search:{
                                    providerId:null,
                                    providerName:null,
                                    providerSFZ:null,
                                    linkId:null            
                                },
                            tbody:{
                                    rowsData:[]
                                },
                            pagination:{
                                currentPage:1,
                                pageSize:10,
                                total:0
                            }  
                        },
                        pagination:{
                            currentPage:1,
                            pageSize:10,
                            total:0
                        }
            }, 
            root:{
                popover:{
                    cache:{
                        nurseData:[],
                    },
                    form:{
                            providerName:null ,
                            createTimeGreater:null ,
                            createTimeLess:null,
                            linkTimeLess:null,
                            linkTimeGreater:null,
                            nurseName:null,
                            isNew:null
                    }
                },
                table:{
                    option:{
                        loading:true
                    },
                    rowsData:[],
                    pagination:{
                        currentPage:1,
                        pageSize:10,
                        total:0
                    }
                },
                dialog:{
                    isCheckBox:false,
                    cache:{
                        linkPointDataItem:[{id:1,name:'123123'}],
                        linkEffectDataItem:[],
                        linkPromiseDataItem:[]
                    },
                    config:{
                        title:null,
                        isShow:false,
                        isNurse:false,
                        buttonShow:false,
                        isTableShow:false,
                        isEdit:false,
                        rowIndex:null,
                        buttonType:false,
                    },
                    height:{
                        height: document.documentElement.clientHeight - 90+ 'px',
                        overflowY: 'auto',
                        width:'100%'
                    },
                    pulpworkInfo:{
                        cardid:null,
                        datatype:null
                    },              
                    form:{
                        id: null,
                        isNew: null,
                        cardId:null,
                        jycyxj: null,
                        linkEffect:[],
                        linkNurseDeptId: null,
                        linkNurseId: null,
                        linkNurseName: null,
                        linkPoint:[],
                        linkPromise:[],
                        linkProviderId: null,
                        linkTime: null,
                        providerName:null,
                        pycyxj: null,
                        createTime:this.timestampToTime(new Date(),'yyyy-mm-dd'),
                        nurse:null,
                        
                    },
                    table:{
                        rowsData:[]
                    },
                    dialog:{
                        conDate:null,
                        conContent:null
                    },
                    timer:{
                        alarmClock:null,
                        hour:0,
                        min:0,
                        second:0,
                        textHour:'0',
                        textMin:'0',
                        textSecond:'0',
                    },
                  
                },
            }
        }
    },
    created(){
        window.self = this;
    },
    mounted(){
       let self = this;
       self.init(); 
    },
    props:['isComplete'],
    watch:{},
    components:{pulpworkInfo},
    computed:{
        outHeight(){//外部表格高度
            return this.$store.state.clientHeight-184;
        },
        //内部dialog(弹窗内部)表格高度
        innerTableHeight(){
            return this.$store.state.clientHeight-280;
        },
    },
    methods:{
        //初始化数据
        init(){
            let self = this;
            //初始化表格数据
            self.initRootTableData();
            //初始化缓存（医生护士）
            self.initNurseCache();
            //初始化提醒项
            self.initLinkMsg();
        },
        //初始化护士缓存信息
        initNurseCache(){
            let self = this;
            //所有护士信息 此处依赖统计模块的查询所有护士接口，如果该处报错或护士信息未查询到，请核对统计模块后端接口是否启动
            analysisHttp.getAllNurse({isCollNurse:false}).then(res=>{
                self.root.popover.cache.nurseData = res.content;
            });
        },
        //初始化链接提醒项数据
        initLinkMsg(){
            let self = this;
            //浆站基础信息缓存 链接环节
            api.getCodeDataByCodeType('link_point').then(res=>{
                self.root.dialog.cache.linkPointDataItem = res.content;
            });
            //浆站基础信息缓存 链接效果
            api.getCodeDataByCodeType('link_effect').then(res=>{
                self.root.dialog.cache.linkEffectDataItem = res.content;
            });
            //浆站基础信息缓存 链接承诺
            api.getCodeDataByCodeType('link_promise').then(res=>{
                self.root.dialog.cache.linkPromiseDataItem = res.content;
            });
        },
        //条件查询表格数据
        initRootTableData(type){
            let self  = this;
            if(type==='clear'){
                self.clearSearch();
            }
            let params={
                currentPage:self.root.table.pagination.currentPage,
                pageSize:self.root.table.pagination.pageSize,
                nurseName:self.root.popover.form.nurseName ,
                providerName:self.root.popover.form.providerName ,
                createTimeLess:self.root.popover.form.createTimeLess,
                createTimeGreater:self.root.popover.form.createTimeGreater,
                linkTimeLess: self.root.popover.form.linkTimeLess,
                linkTimeGreater: self.root.popover.form.linkTimeGreater,
                isNew:self.root.popover.form.isNew,
                isComplete:self.isComplete==true?"1":"2",  
            };
            bloodSourcesHttp.getTableXyFiveLink(params).then(res=>{
                self.root.table.rowsData = res.content.items;
                self.root.table.pagination.total = res.content.total;
                self.root.table.option.loading = false;
            });
        },
        //点击表格分页每页显示多少条数据处理
        xySizeChange(size){
            let self = this;
            self.root.table.pagination.pageSize = size;
            self.initRootTableData();
        },
        //点击表格分页页数处理
        xyCurrentChange(currentPage){
            let self = this;
            self.root.table.pagination.currentPage = currentPage;
            self.initRootTableData();
        },
        //清空查询条件
        clearSearch(){
            let self = this;
            self.root.popover.form.nurseName=null;
            self.root.popover.form.providerName=null;
            self.root.popover.form.createTimeLess=null;
            self.root.popover.form.createTimeGreater=null;     
            self.root.popover.form.linkTimeLess=null;
            self.root.popover.form.linkTimeGreater=null;     
            self.root.popover.form.isNew=null;     
        },
        //清空dialog.form的数据
        clearForm(){
            let self = this;
            self.root.dialog.form.id = null,
            self.root.dialog.form.isNew =  null,
            self.root.dialog.form.jycyxj =  null,
            self.root.dialog.form.linkEffect =[],
            self.root.dialog.form.linkNurseDeptId = null,
            self.root.dialog.form.linkNurseId = null,
            self.root.dialog.form.linkNurseName =null,
            self.root.dialog.form.linkPoint = [],
            self.root.dialog.form.linkPromise = [],
            self.root.dialog.form.linkProviderId = null,
            self.root.dialog.form.linkTime= null,
            self.root.dialog.form.providerName= null,
            self.root.dialog.form.pycyxj= null,
            self.root.dialog.form.createTime= this.timestampToTime(new Date(),'yyyy-mm-dd'),
            self.root.dialog.form.nurse= null                 
        },
        //添加按钮事件处理
        addButtonEventFun(){
            //打开弹窗
            let self = this;
            //打开dialog
            self.root.dialog.config.isShow = true; 
            self.root.dialog.config.buttonType = false;
            self.root.dialog.pulpworkInfo.cardid='1';
            self.clearForm();
            //将当前编辑表格数据赋值到对应的弹窗表单项中
        },
          //点击编辑按钮将表单行值赋值给对应的表单项
        setTableRowValToFormVal(row){
            let self = this;
            //设置基础性组件查询接口类型 datatype='provider' 表示从浆员基础信息表查询 provider_info 数据库表查询
            self.root.dialog.pulpworkInfo.datatype='provider';
            //通过浆员的卡号 cardid=row.cardId 进行符合条件卡号的数据查询展示
            self.root.dialog.pulpworkInfo.cardid=row.cardId;
            //进行表格行[tablerow]数据赋值给弹窗回显的表单[form]
            self.root.dialog.form = row;
            //处理时间展示 后台数据未时间戳 ，必须转换为用户能看懂的数据
            self.root.dialog.form.linkTime=(row.linkTime==null||row.linkTime==='undefined'||row.linkTime==='')?self.timestampToTime(new Date(),'yyyy-mm-dd hh:mm:ss'):self.timestampToTime(row.linkTime,'yyyy-mm-dd');
            self.root.dialog.form.createTime=(row.createTime==null||row.createTime==='undefined'||row.createTime==='')?self.timestampToTime(new Date(),'yyyy-mm-dd hh:mm:ss'):self.timestampToTime(row.createTime,'yyyy-mm-dd');
            //处理护士姓名问题
            self.root.dialog.form.nurse ={
                id:row.linkNurseId
            }
            //处理满意度选项
            if(self.root.dialog.form.linkPoint==null||self.root.dialog.form.linkPoint===""||self.root.dialog.form.linkPoint==="undefined"){
                self.root.dialog.form.linkPoint = [];
            }else{
                self.root.dialog.form.linkPoint= self.root.dialog.form.linkPoint.split(",");
            }
            if(self.root.dialog.form.linkEffect==null||self.root.dialog.form.linkEffect===""||self.root.dialog.form.linkEffect==="undefined"){
                self.root.dialog.form.linkEffect = [];
            }else{
                self.root.dialog.form.linkEffect= self.root.dialog.form.linkEffect.split(",");
            }
            if(self.root.dialog.form.linkPromise==null||self.root.dialog.form.linkPromise===""||self.root.dialog.form.linkPromise==="undefined"){
                self.root.dialog.form.linkPromise = [];
            }else{
                self.root.dialog.form.linkPromise= self.root.dialog.form.linkPromise.split(",");
            }
            //处理下拉选项数据绑定显示，由于后台返回的是数字类型，而前端框架记录的是字符串类型valueString != valueNumber 所以会有展示问题，不要问我为什么后台数据库不存varchar的，历史因素，业务关联因素，还有懒！
            if(self.root.dialog.form.isNew==1){
               self.root.dialog.form.isNew='1';
            }
            if(self.root.dialog.form.isNew==2){
               self.root.dialog.form.isNew='2';
            }
        },
        //编辑按钮事件处理
        editButtonEventFun(type,row){
            //打开弹窗
            let self = this;
            //打开dialog
            self.root.dialog.config.isShow = true; 
            self.root.dialog.config.buttonType = true;
            //将当前编辑表格数据赋值到对应的弹窗表单项中
            self.setTableRowValToFormVal(row);
        },
        //打开选人弹窗
        innerDialogShow(){
            let self = this;
            //打开弹窗
            self.dialog.inner.config.isShow = true;
            //设置弹窗标题
            self.dialog.inner.config.title = "";
            //弹窗共享类型type=inputStore为添加，弹窗控件添加元素的展示，编辑元素的东西退出
            self.dialog.inner.config.type = "userSelect";
            //查询相关数据
            self.getInitInnerTableXyList();
        },
        //
        //获取内部表格信息 人员信息
        getInitInnerTableXyList(type){
            let self  = this;
            if(type==='clear'){
                self.tableData.inner.search.providerId = '';
                self.tableData.inner.search.providerName = '';
                self.tableData.inner.search.providerSFZ  = '';
            }
            if(type==='all'){
                //占无逻辑
            }
            let params={
                    currentPage:self.tableData.inner.pagination.currentPage,
                    pageSize:self.tableData.inner.pagination.pageSize,
                    cardId:self.tableData.inner.search.providerId,
                    providerName:self.tableData.inner.search.providerName,
                    idNo:self.tableData.inner.search.providerSFZ                       
            };
            //查询用户数据，以供义工、浆员框选择使用
            api.providerInfo(params).then(res=>{
                    self.tableData.inner.tbody.rowsData = res.content.records;
                    self.tableData.inner.pagination.total = res.content.total;
                },error=>{
                    self.option.loading = false;
                })
        },
        //点击内部切换分页（内部）
        xyLinkInnerCurrentChange(currentPage){
                this.tableData.inner.pagination.currentPage=currentPage;
                this.getInitInnerTableXyList()
        },
        // 更改内部每条页面显示数量（内部）
        xyLinkInnerSizeChange(size){
                this.tableData.inner.pagination.pageSize = size;
                this.getInitInnerTableXyList();
        }, 
        //提交
        updateButtonEventFun(){
            let self = this;
            //进行数据转化
            var params=self.root.dialog.form;
            var newObject = new Object();
            //处理3个数组
            debugger;
            newObject.linkPoint =  self.root.dialog.form.linkPoint.join(',') ;
            newObject.linkEffect =  self.root.dialog.form.linkEffect.join(',') ;
            newObject.linkPromise =  self.root.dialog.form.linkPromise.join(',') ;
            params.linkPoint = newObject.linkPoint ;
            params.linkEffect = newObject.linkEffect ;
            params.linkPromise = newObject.linkPromise ;
            //进行护士数据转换
            params.linkNurseId =  self.root.dialog.form.nurse.id;
            params.linkNurseName = self.root.dialog.form.nurse.name;
            debugger;
            params.linkNurseDeptId = self.root.dialog.form.nurse.deptId;
            if(self.root.dialog.config.buttonType){          
                //编辑
                bloodSourcesHttp.updateXyFiveLinkInfo(params).then(res=>{
                        if(res.content){
                            self.$message({
                                        message: '编辑成功！',
                                        type: 'warning'
                                    }); 
                            //关闭
                            self.root.dialog.config.isShow = false;
                            //刷新表单
                            self.initRootTableData('clear');
                            //清空dialog数据
                            self.clearForm();
                        }else{
                            self.$message({
                                        message: '添加失败！',
                                        type: 'warning'
                                    }); 
                        }
                });
            }else{
                //进行新增数据提交
                bloodSourcesHttp.insertXyFiveLinkInfo(params).then(res=>{
                        if(res.content){
                            self.$message({
                                        message: '添加成功！',
                                        type: 'warning'
                                    }); 
                            //关闭
                            self.root.dialog.config.isShow = false;
                            //刷新表单
                            self.initRootTableData('clear');
                            //清空dialog数据
                            self.clearForm();
                        }else{
                            self.$message({
                                        message: '添加失败！',
                                        type: 'warning'
                                    }); 
                        }
                });

            }
        },
        //设置
        fetchRowInfo(row){
             let self = this;
             self.root.dialog.pulpworkInfo.cardid = row.cardId;
             self.root.dialog.pulpworkInfo.datatype = 'provider';
             self.root.dialog.form.linkProviderId = row.id;
             self.root.dialog.form.cardId =  row.cardId;
             self.root.dialog.form.providerName = row.name;//浆员姓名
             //临时定义数据
             self.dialog.inner.config.isShow = false;
        },
    },
}
</script>
<style scoped>

</style>